<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>修改赛事</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="stylesheet" href="../css/font.css">
    <link rel="stylesheet" href="../css/xadmin.css">
    <script type="text/javascript" src="../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../js/xadmin.js"></script>
    <script src="../js/base.js"></script>
    <script src="../js/jquery.min.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        .juese {
            text-align: center;
            width: 90%;
            border: 1px solid #ccc;
            margin: 20px auto;
        }

        .juese th {
            text-align: center;
            background: #fff;
        }

        .layui-row .juese .layui-table td,
        .layui-row .juese .layui-table th {
            font-size: 14px;
        }

        .layui-col-md4 label {
            width: 30%;
            padding: 9px 0;
            font-size: 14px;
            color: #999;
        }

        .layui-col-md4 div {
            line-height: 38px;
            width: 70%;
            text-align: left;
            font-size: 14px;
            box-sizing: border-box;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            padding-left: 10px;
        }

        .layui-col-md3 label {
            width: 30%;
            padding: 9px 0;
            font-size: 14px;
            color: #999;
        }

        .layui-col-md3 div {
            line-height: 38px;
            width: 70%;
            text-align: left;
            font-size: 14px;
            box-sizing: border-box;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            padding-left: 10px;
        }

        .layui-col-md5 label {
            width: 30%;
            padding: 9px 0;
            font-size: 14px;
            color: #999;
        }

        .layui-col-md5 div {
            line-height: 38px;
            width: 70%;
            text-align: left;
            font-size: 14px;
            box-sizing: border-box;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            padding-left: 10px;
        }

        .layui-col-md6 label {
            width: 30%;
            padding: 9px 0;
            font-size: 14px;
            color: #999;
        }

        .layui-col-md6 div {
            line-height: 38px;
            width: 70%;
            text-align: left;
            font-size: 14px;
            box-sizing: border-box;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            padding-left: 10px;
        }

        .layui-input-inline {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .layui-table th {
            background-color: #f2f2f2;
        }

        .layui-anim.layui-anim-upbit {
            max-height: 150px;

        }
    </style>
</head>

<body>
<div class="layui-fluid" style="height: 327px;">
    <div class="layui-row" style="padding-right: 9%;">
        <form class="layui-form">
            <div class="layui-form-item">
                <label class="layui-form-label" style="padding-left: 0;">姓名</label>
                <div class="layui-input-block">
                    <input type="text" id="name" autocomplete="off" class="layui-input" disabled
                           style="cursor: not-allowed;">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="padding-left: 0;">ID</label>
                <div class="layui-input-block">
                    <input type="text" name="id" id="ID" autocomplete="off" class="layui-input" disabled
                           style="cursor: not-allowed;">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="padding-left: 0;">等级</label>
                <div class="layui-input-block">
                    <select name="level" id="level" lay-verify="required">
                        <option value=""></option>
                        <option value="1">1级</option>
                        <option value="2">2级</option>
                        <option value="3">3级</option>
                        <option value="4">4级</option>
                        <option value="5">5级</option>
                        <option value="6">6级</option>
                        <option value="7">7级</option>
                        <option value="8">8级</option>
                        <option value="9">9级</option>
                        <option value="10">10级</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item" style="text-align: center;margin-top: 100px;">
                <button type="button" class="layui-btn" lay-submit lay-filter="submit">立即提交</button>
            </div>
        </form>
    </div>
</div>
</body>
<script>
    function child() {
        layui.use(['form'], function () {
            var form = layui.form;
            form.render()
            form.on('submit(submit)', function (data) {
                var id = data.field.id;
                var level = data.field.level;
                if (level == "") {
                    layer.alert('请选择修改等级', {
                        title: "提示"
                    })
                    return false
                }
                // allotPlayerLevel
                $.ajax({
                    type: "get",
                    url: allotPlayerLevel,
                    data: {
                        playerId: id,
                        credentialLevel: level,
                    },
                    success: function (res) {
                        if (res.msg == 0) {
                            layer.alert("修改成功", {
                                title: "提示",
                                cancel: function () {
                                    parent.layui.table.reload("testReload");
                                    xadmin.close()
                                }
                            }, function () {
                                parent.layui.table.reload("testReload");
                                xadmin.close()
                            });
                        } else {
                            layer.alert(res.msg, {
                                title: "提示",
                                cancel: function () {
                                    parent.layui.table.reload("testReload");
                                    xadmin.close()
                                }
                            }, function () {
                                parent.layui.table.reload("testReload");
                                xadmin.close()
                            });
                        }
                    },
                    error: function (error) {
                        console.log(error)
                    }
                })
                return false
            })
        })


    };
</script>

</html>